package com.zhanglu.fun.services.website.config;

import com.zhanglu.fun.services.website.security.SecurityInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * @description
 * @Auther zhanglu
 * @Date 2017/9/19 下午3:44
 */
@Configuration
public class WebConfig extends WebMvcConfigurerAdapter {

    @Bean
    SecurityInterceptor securityInterceptor() {
        return new SecurityInterceptor();
    }

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(securityInterceptor()).addPathPatterns("/**");
    }
}
